{% extends "base.html" %}
{% block pagetitle %}{{MSG_AP_REQUEST_APPROVAL}}{% endblock %}
{% block content %}
<br>
<br>

{% if show_pending %}
  <b>{{MSG_AP_SHOW_PENDING}}</b>
{% else %}
  <a href=/approvals?list=pending>{{MSG_AP_SHOW_PENDING}}</a>
{% endif %}
&nbsp;&nbsp;
{% if show_approved %}
  <b>{{MSG_AP_SHOW_APPROVED}}</b>
{% else %}
  <a href=/approvals?list=approved> {{MSG_AP_SHOW_APPROVED}}</a>
{% endif %}
&nbsp;&nbsp;
{% if show_denied %}
  <b>{{MSG_AP_SHOW_DENIED}}</b>
{% else %}
  <a href=/approvals?list=denied>{{MSG_AP_SHOW_DENIED}}</a>
{% endif %}


{% if show_pending %}
<h1> {{MSG_AP_REQUIRE_ACTION}}: </h1>
{% endif %}

{% if show_approved %}
<h1> {{MSG_AP_ENTRIES_HAVE_BEEN}} <font color=green>{{MSG_AP_APPROVED}}</font>! </h1>
{% endif %}

{% if show_denied %}
<h1> {{MSG_AP_ENTRIES_HAVE_BEEN}} <font color=red>{{MSG_AP_DENIED}}</font>! </h1>
{% endif %}

{% if user_approvals %}
<h2> {{MSG_USER_ROLES}} </h2>
<div class=art-box>
{% for app in user_approvals %}
  <div class=art-box2>
    {{app.creator.nickname}} {{MSG_AP_REQUESTS_TO_BE}} <font color=red> {{app.type_str}} </font>. 
    {{MSG_AP_REASON}}:<br>
    {{app.request_note}}
    {% ifequal app.state UserLevelApplication_PENDING %}
        <form class="art-form-left" action="/approvals" method="post">
          <input type="hidden" name="appid" value="{{app.key}}" />
          <input type="hidden" name="type" value="user" />
          <input type="hidden" name="post_action" value="submit"</input>
          <input type="submit" name='approve' value="{{MSG_AP_APPROVE}}" />
          <input type="submit" name='deny' value="{{MSG_AP_DENY}}" />
        </form>
    {% endifequal %}
    <br><br>{{app.date}}
    </div>
{% endfor %}
</div>
{% endif %}

{% if donor_profiles %}
<h2> {{MSG_AP_DONOR_PROFILE}} </h2>
{% for profile in donor_profiles %}
  {% include "donor_profile.html" %}
  {% ifequal profile.state DonorProfile_PENDING %}
      <form class="art-form-left" action="/approvals" method="post">
        <input type="hidden" name="profileid" value="{{profile.key}}" />
        <input type="hidden" name="type" value="donor" />
          <input type="hidden" name="post_action" value="submit"</input>
        <input type="submit" name='approve' value="{{MSG_AP_APPROVE}}" />
        <input type="submit" name='deny' value="{{MSG_AP_DENY}}" />
      </form>
  {% endifequal %}
{% endfor %}
{% endif %}

{% if manufacturer_profiles %}
<h2> {{MSG_AP_MANUFACTURER_PROFILE}} </h2>
{% for profile in manufacturer_profiles %}
  {% include "manufacturer_profile.html" %}
  {% ifequal profile.state ManufacturerProfile_PENDING %}
      <form class="art-form-left" action="/approvals" method="post">
        <input type="hidden" name="profileid" value="{{profile.key}}" />
        <input type="hidden" name="type" value="manufacturer" />
        <input type="hidden" name="post_action" value="submit"</input>
        <input type="submit" name='approve' value="{{MSG_AP_APPROVE}}" />
        <input type="submit" name='deny' value="{{MSG_AP_DENY}}" />
      </form>
  {% endifequal %}
{% endfor %}
{% endif %}

{% endblock %}
